﻿<!-- #include file="mymin.asp" -->
<card title="帖子管理"><p>
<%
w systemMsgRoot

dim p,sql,sqlEx
p=getN("p",1)
if p<1 then p=1
sqlEx=""

'bbsid 如果带有这个参数则取该论坛的帖子
Dim bbsid
bbsid=getN("bbsid",0)
If bbsid>0 Then
	sqlEx = "where classid="&bbsid
End If

dim rs
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select id,title from 74hu_topic "&sqlEx&" order by id desc",myconn,1,1
If Not rs.eof	Then
	dim pagesize,count,page,i,pagecount,id
	PageSize=10
	Count=rs.recordcount
	page=getN("page",1)
	if page<1 then page=1
	pagecount=(count+pagesize-1)\pagesize
	if page>pagecount then page=pagecount
	rs.move(pagesize*(page-1))
	w "共"&count&"篇帖子<br/>"
	For i=1 To PageSize
	If rs.eof Then Exit For
		id=rs("ID")
		title=nowml(rs("title"))
		w "[<a href=""edit.asp?sid="&sid&"&amp;id="&id&""">管理</a>]"&id&".<a href=""post.asp?sid="&sid&"&amp;id="&id&"&amp;"">"&title&"</a><br/>"
		rs.moveNext
	Next
	w showPage("posts.asp", "p:"&p, page, pageCount)&"<br/>"

Else
	w "暂时没有帖子！<br/>"
end if
rs.close
set rs=nothing

w "----------"

call bbsLast
%>